package com.niiwoo.civet.account.service.local;

import com.niiwoo.civet.account.dao.entity.GroupAccountCorrelateOrder;
import com.niiwoo.civet.account.dao.mapper.GroupAccountCorrelateOrderMapperExt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 集团账户关联订单服务
 */
@Service
public class GroupAccountCorrelateOrderService {

    @Autowired
    GroupAccountCorrelateOrderMapperExt groupAccountCorrelateOrderMapper;

    /**
     * 获取订单
     *
     * @param requestNo 请求流水号
     */
    public GroupAccountCorrelateOrder getByRequestNo(String requestNo) {
        return groupAccountCorrelateOrderMapper.selectByRequestNo(requestNo);
    }

    public boolean saveOrder(GroupAccountCorrelateOrder order) {
        return groupAccountCorrelateOrderMapper.insertSelective(order) > 0;
    }

    public boolean updateOrder(GroupAccountCorrelateOrder order) {
        return groupAccountCorrelateOrderMapper.updateByPrimaryKeySelective(order) > 0;
    }

}
